/*
 * load_cc.c
 *
 *  Created on: 2012/07/31
 *      Author: owner
 */

#include <stdio.h>
#include "sqlite3.h"
#include "db_def.h"
#include "core.h"
#include "core_internal.h"
#include "Id.h"
#include "../../CCore/table/table.h"
#include "../../CCore/parser/cc/cc.h"
#include "../../CCore/parser/coredef.h"
#include "../../CCore/table/core_table.h"

/*TBL_DECLARATION*/
static INT loadDeclaration(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_DECLARATION, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stDeclarationAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stDeclarationAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		stDeclarationAccess.typeSpecifier.set(tblIndex,
				sqlite3_column_int(stmt, DECL_TYPE_SPECIFIER_INFO - 1));

		stDeclarationAccess.declarator.set(tblIndex,
				sqlite3_column_int(stmt, DECL_DECLARATOR_INFO - 1));

		stDeclarationAccess.codeScp.set(tblIndex,
				sqlite3_column_int(stmt, DECL_CODE_SCOPE_INFO - 1));

		stDeclarationAccess.parentKind.set(tblIndex,
				sqlite3_column_int(stmt, DECL_PARENT_KIND - 1));

		stDeclarationAccess.namespace.set(tblIndex,
				sqlite3_column_int(stmt, DECL_NAMESPACE_KIND - 1));

		stDeclarationAccess.parentIdx.set(tblIndex,
				sqlite3_column_int(stmt, DECL_PARENT_INDEX - 1));

		stDeclarationAccess.translationUnit.set(tblIndex,
				sqlite3_column_int(stmt, DECL_TRANSUNIT_INFO - 1));

		stDeclarationAccess.next.set(tblIndex,
				sqlite3_column_int(stmt, DECL_NEXT_DECLARATION_INFO - 1));

	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_DECLARATOR*/
static INT loadDeclarator(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;
	U2 declaratorKind = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_DECLARATOR, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stDeclaratorAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stDeclaratorAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		stDeclaratorAccess.nextDeclarator.set(tblIndex,
				sqlite3_column_int(stmt, DECLARATOR_NEXT_DECLARATOR_INFO - 1));

		stDeclaratorAccess.parentDeclarator.set(tblIndex,
				sqlite3_column_int(stmt,
				DECLARATOR_PARENT_DECLARATOR_INFO - 1));

		stDeclaratorAccess.declaration.set(tblIndex,
				sqlite3_column_int(stmt, DECLARATOR_DECLARATION_INFO - 1));

		declaratorKind = sqlite3_column_int(stmt,
		DECLARATOR_DECLARATOR_KIND - 1);
		stDeclaratorAccess.declaratorKind.set(tblIndex, declaratorKind);

		switch (declaratorKind) {
		case DECLARATOR_BITFIELD:
			stDeclaratorAccess.bitIdx.set(tblIndex,
					sqlite3_column_int(stmt, DECLARATOR_X_TBL_INFO - 1));
			break;

		case DECLARATOR_ARRAY:
			stDeclaratorAccess.arrayIdx.set(tblIndex,
					sqlite3_column_int(stmt, DECLARATOR_X_TBL_INFO - 1));
			break;

		case DECLARATOR_FUNC:
			stDeclaratorAccess.paramChain.set(tblIndex,
					sqlite3_column_int(stmt, DECLARATOR_X_TBL_INFO - 1));
			break;

		case DECLARATOR_INIT:
			stDeclaratorAccess.initialExpList.set(tblIndex,
					sqlite3_column_int(stmt, DECLARATOR_X_TBL_INFO - 1));
			break;

		case DECLARATOR_SYM:
			stDeclaratorAccess.symbol.set(tblIndex,
					sqlite3_column_int(stmt, DECLARATOR_X_TBL_INFO - 1));
			break;

		case DECLARATOR_POINTER:
			stDeclaratorAccess.constNum.set(tblIndex, sqlite3_column_int(stmt,
			DECLARATOR_POINTER_CONST_NUMBER - 1));
			stDeclaratorAccess.volatileNum.set(tblIndex,
					sqlite3_column_int(stmt,
					DECLARATOR_POINTER_VOLATILE_NUMBER - 1));
			stDeclaratorAccess.restrictNum.set(tblIndex,
					sqlite3_column_int(stmt,
					DECLARATOR_POINTER_RESTRICT_NUMBER - 1));
			break;

		default:
			break;
		}

		stDeclaratorAccess.childDeclarator.set(tblIndex,
				sqlite3_column_int(stmt, DECLARATOR_CHILD_DECLARATOR_INFO - 1));

		stDeclaratorAccess.type.set(tblIndex,
				sqlite3_column_int(stmt, DECLARATOR_TYPE_INFO - 1));

		stDeclaratorAccess.codeScp.set(tblIndex,
				sqlite3_column_int(stmt, DECLARATOR_CODE_SCOPE_INFO - 1));

	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_TYPESPECIFIER*/
static INT loadTypeSpecifier(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;
	U2 specifyKind = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_TYPESPECIFIER, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stTypeSpecifierAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stTypeSpecifierAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		stTypeSpecifierAccess.restrictNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_RESTRICT_NUMBER - 1));

		stTypeSpecifierAccess.volatileNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_VOLATILE_NUMBER - 1));

		stTypeSpecifierAccess.constNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_CONST_NUMBER - 1));

		stTypeSpecifierAccess.externNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_EXTERN_NUMBER - 1));

		stTypeSpecifierAccess.staticNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_STATIC_NUMBER - 1));

		stTypeSpecifierAccess.autoNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_AUTO_NUMBER - 1));

		stTypeSpecifierAccess.typedefNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_TYPEDEF_NUMBER - 1));

		stTypeSpecifierAccess.registerNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_REGISTER_NUMBER - 1));

		stTypeSpecifierAccess.interruptNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_INTERRUPT_NUMBER - 1));

		stTypeSpecifierAccess.inlineNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_INLINE_NUMBER - 1));

		stTypeSpecifierAccess.asmNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_ASM_NUMBER - 1));

		stTypeSpecifierAccess.nearNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_NEAR_NUMBER - 1));

		stTypeSpecifierAccess.farNum.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_FAR_NUMBER - 1));

		specifyKind = sqlite3_column_int(stmt, SPECIFIER_SPECIFIER_KIND - 1);
		stTypeSpecifierAccess.specifyKind.set(tblIndex, specifyKind);

		if (specifyKind == TYPEDEF_BASE) {
			stTypeSpecifierAccess.signNum.set(tblIndex,
					sqlite3_column_int(stmt, SPECIFIER_SIGNED_NUMBER - 1));

			stTypeSpecifierAccess.unsigneNum.set(tblIndex,
					sqlite3_column_int(stmt, SPECIFIER_UNSIGNED_NUMBER - 1));

			stTypeSpecifierAccess.longNum.set(tblIndex,
					sqlite3_column_int(stmt, SPECIFIER_LONG_NUMBER - 1));

			stTypeSpecifierAccess.shortNum.set(tblIndex,
					sqlite3_column_int(stmt, SPECIFIER_SHORT_NUMBER - 1));
		} else if (specifyKind == TYPEDEF_UNION || specifyKind == TYPEDEF_STRUCT
				|| specifyKind == TYPEDEF_ENUM) {
			stTypeSpecifierAccess.memberChain.set(tblIndex,
					sqlite3_column_int(stmt, SPECIFIER_MEMBER_CHAIN_INFO - 1));
		}

		stTypeSpecifierAccess.symbol.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_SYMBOL_INFO - 1));

		stTypeSpecifierAccess.typeinfo.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_TYPE_INFO - 1));

		stTypeSpecifierAccess.declaration.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_DECLARATION_INFO - 1));

		stTypeSpecifierAccess.codeScp.set(tblIndex,
				sqlite3_column_int(stmt, SPECIFIER_CODE_SCOPE_INFO - 1));

	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_EXPRESSION*/
static INT loadExpression(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;
	U4 opKind = 0;
	U2 parentKind = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_EXPRESSION, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stExpressionAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stExpressionAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		opKind = sqlite3_column_int(stmt, EXP_OP_KIND - 1);
		stExpressionAccess.opKind.set(tblIndex, opKind);

		switch (opKind) {
		case EXPR_CONSTANT:
			stExpressionAccess.result_value.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PRIMARY_X_INFO - 1));
			break;

		case EXPR_STRING:
			stExpressionAccess.result_constStr.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PRIMARY_X_INFO - 1));
			break;

		case EXPR_DECLARATION:
			stExpressionAccess.result_declaration.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PRIMARY_X_INFO - 1));
			break;

		case EXPR_IDENTIFIER:
			stExpressionAccess.result_symbol.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PRIMARY_X_INFO - 1));
			break;

		case EXPR_TOKEN:
			stExpressionAccess.result_temp_token.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PRIMARY_X_INFO - 1));
			break;

		case EXPR_STATEMENT:
			stExpressionAccess.result_statement.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PRIMARY_X_INFO - 1));
			break;

		case EXPR_INITEXPRLIST:
			stExpressionAccess.result_exprlist.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PRIMARY_X_INFO - 1));
			break;

		default:
			break;
		}

		stExpressionAccess.type.set(tblIndex,
				sqlite3_column_int(stmt, EXP_TYPE_INFO - 1));

		stExpressionAccess.castedType.set(tblIndex,
				sqlite3_column_int(stmt, EXP_CASTED_TYPE_INFO - 1));

		stExpressionAccess.constValue.set(tblIndex,
				sqlite3_column_int(stmt, EXP_CALCUTE_VALUE_INFO - 1));

		stExpressionAccess.codeScp.set(tblIndex,
				sqlite3_column_int(stmt, EXP_CODE_SCOPE_INFO - 1));

		stExpressionAccess.bIllegal.set(tblIndex,
				sqlite3_column_int(stmt, EXP_IS_ILLEGAL_EXP - 1));

		stExpressionAccess.blValue.set(tblIndex,
				sqlite3_column_int(stmt, EXP_IS_L_VALUE - 1));

		stExpressionAccess.bModifiabe.set(tblIndex,
				sqlite3_column_int(stmt, EXP_IS_MODIFIABLE - 1));

		stExpressionAccess.constFlg.set(tblIndex,
				sqlite3_column_int(stmt, EXP_CONST_FLAG - 1));

		parentKind = sqlite3_column_int(stmt, EXP_PARENT_KIND - 1);
		stExpressionAccess.parentKind.set(tblIndex, parentKind);

		switch (parentKind) {
		case KIND_STATEMENTINFO:
			stExpressionAccess.parent_statement.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PARENT_TABLE_INFO - 1));
			break;

		case KIND_EXPRESSIONINFO:
			stExpressionAccess.parent_expression.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PARENT_TABLE_INFO - 1));
			break;

		case KIND_INITIALEXPLIST:
			stExpressionAccess.parent_explist.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PARENT_TABLE_INFO - 1));
			break;

		case KIND_DECLARATOR:
			stExpressionAccess.parent_declarator.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PARENT_TABLE_INFO - 1));
			break;

		case KIND_INITDESIGNATION:
			stExpressionAccess.parent_designation.set(tblIndex,
					sqlite3_column_int(stmt, EXP_PARENT_TABLE_INFO - 1));
			break;

		default:
			break;
		}

		stExpressionAccess.leftChild.set(tblIndex,
				sqlite3_column_int(stmt, EXP_LEFT_NODE_EXP_INFO - 1));

		stExpressionAccess.rightChild.set(tblIndex,
				sqlite3_column_int(stmt, EXP_RIGHT_NODE_EXP_INFO - 1));

	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_EXPRESSIONLIST*/
static INT loadExpressionList(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;
	U2 paramKind = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_EXPRESSIONLIST, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stExpressionListAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stExpressionListAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		stExpressionListAccess.bIllegal.set(tblIndex,
				sqlite3_column_int(stmt, EXPLIST_IS_ILLEGAL - 1));

		stExpressionListAccess.constFlg.set(tblIndex,
				sqlite3_column_int(stmt, EXPLIST_CONST_FLAG - 1));

		stExpressionListAccess.parentKind.set(tblIndex,
				sqlite3_column_int(stmt, EXPLIST_PARENT_KIND - 1));

		paramKind = sqlite3_column_int(stmt, EXPLIST_PARAM_KIND - 1);
		stExpressionListAccess.parameterKind.set(tblIndex, paramKind);

		switch (paramKind) {
		case KIND_INITIALEXPLIST:
			stExpressionListAccess.expressionList.set(tblIndex,
					sqlite3_column_int(stmt, EXPLIST_EXP_X_INFO - 1));
			break;
		case KIND_EXPRESSIONINFO:
			stExpressionListAccess.expression.set(tblIndex,
					sqlite3_column_int(stmt, EXPLIST_EXP_X_INFO - 1));
			break;
		default:
			break;
		}

		stExpressionListAccess.next.set(tblIndex,
				sqlite3_column_int(stmt, EXPLIST_NEXT_EXP_LIST_INFO - 1));

		stExpressionListAccess.parent.set(tblIndex,
				sqlite3_column_int(stmt, EXPLIST_PARENT_INFO - 1));

		stExpressionListAccess.codeScp.set(tblIndex,
				sqlite3_column_int(stmt, EXPLIST_CODE_SCOPE_INFO - 1));

		stExpressionListAccess.designation.set(tblIndex,
				sqlite3_column_int(stmt, EXPLIST_DESIGNATION_INFO - 1));
	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_INITIALIZERDESIGNATION*/
static INT loadInitializerDesignation(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;
	U2 kind = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_INITIALIZERDESIGNATION, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stInitDesignationAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stInitDesignationAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		kind = sqlite3_column_int(stmt, INIT_DESIGNATION_KIND - 1);
		stInitDesignationAccess.kind.set(tblIndex, kind);

		stInitDesignationAccess.bIllegal.set(tblIndex,
				sqlite3_column_int(stmt, INIT_IS_ILLEGAL - 1));

		switch (kind) {
		case DESIGNATION_ARRAY:
			stInitDesignationAccess.const_expression.set(tblIndex,
					sqlite3_column_int(stmt, INIT_X_INFO - 1));
			break;
		case DESIGNATION_MEMBER:
			stInitDesignationAccess.identifier.set(tblIndex,
					sqlite3_column_int(stmt, INIT_X_INFO - 1));
			break;
		case DESIGNATION_TOKEN:
			stInitDesignationAccess.token.set(tblIndex,
					sqlite3_column_int(stmt, INIT_X_INFO - 1));
			break;
		default:
			break;
		}

		stInitDesignationAccess.parent.set(tblIndex,
				sqlite3_column_int(stmt, INIT_PARENT_INFO - 1));

		stInitDesignationAccess.child.set(tblIndex,
				sqlite3_column_int(stmt, INIT_CHILD_INFO - 1));

		stInitDesignationAccess.codeScp.set(tblIndex,
				sqlite3_column_int(stmt, INIT_CODE_SCOPE_INFO - 1));

		stInitDesignationAccess.initializer.set(tblIndex,
				sqlite3_column_int(stmt, INIT_EXP_LIST_INFO - 1));
	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_STATEMENT*/
static INT loadStatement(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;
	U2 stmtKind = 0;
	U2 parentKind = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_STATEMENT, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stStatementAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stStatementAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		stmtKind = sqlite3_column_int(stmt, STMT_STATEMENT_KIND - 1);
		stStatementAccess.statmentKind.set(tblIndex, stmtKind);

		switch (stmtKind) {
		case STMT_DEC:
			stStatementAccess.dec_declaration.set(tblIndex,
					sqlite3_column_int(stmt, STMT_DECLARATION - 1));
			break;
		case STMT_FOR:
			stStatementAccess.for_Init_Decl.set(tblIndex,
					sqlite3_column_int(stmt,
					STMT_FOR_INIT_DECLARATION_INFO - 1));
			stStatementAccess.for_initExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_FOR_INIT_EXP_INFO - 1));
			stStatementAccess.for_CondExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_FOR_COND_EXP_INFO - 1));
			stStatementAccess.for_IncExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_FOR_INC_EXP_INFO - 1));
			stStatementAccess.for_Body.set(tblIndex,
					sqlite3_column_int(stmt, STMT_FOR_BODY_STATEMENT_INFO - 1));
			break;
		case STMT_LABEL:
			stStatementAccess.label_name.set(tblIndex,
					sqlite3_column_int(stmt, STMT_LABEL_SYMBOL_INFO - 1));
			stStatementAccess.label_statement.set(tblIndex,
					sqlite3_column_int(stmt, STMT_LABEL_STATEMENT_INFO - 1));
			stStatementAccess.label_gotoChain.set(tblIndex,
					sqlite3_column_int(stmt, STMT_LABEL_GOTO_CHAIN_INFO - 1));
			break;
		case STMT_CASE:
			stStatementAccess.case_switch.set(tblIndex,
					sqlite3_column_int(stmt, STMT_CASE_SWITCH_STMT_INFO - 1));
			stStatementAccess.case_constExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_CASE_CONST_EXP_INFO - 1));
			stStatementAccess.case_statement.set(tblIndex,
					sqlite3_column_int(stmt, STMT_CASE_CHILD_STMT_INFO - 1));
			stStatementAccess.case_constExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_CASE_NEXT_CASE_INFO - 1));
			break;
		case STMT_DEFAULT:
			stStatementAccess.default_switch.set(tblIndex,
					sqlite3_column_int(stmt,
					STMT_DEFAULT_SWITCH_STMT_INFO - 1));
			stStatementAccess.default_statement.set(tblIndex,
					sqlite3_column_int(stmt, STMT_DEFAULT_CHILD_STMT_INFO - 1));
			break;
		case STMT_BLOCK:
			stStatementAccess.block_stmtlist.set(tblIndex,
					sqlite3_column_int(stmt, STMT_BLOCK_CHAIN_INFO - 1));
			break;
		case STMT_EXP:
			stStatementAccess.exp_exp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_EXP_STMT_EXP_INFO - 1));
			break;
		case STMT_IF:
			stStatementAccess.if_condExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_IF_COND_EXP_INFO - 1));
			stStatementAccess.if_body.set(tblIndex,
					sqlite3_column_int(stmt, STMT_IF_BODY_STMT_INFO - 1));
			stStatementAccess.if_else_body.set(tblIndex,
					sqlite3_column_int(stmt, STMT_IF_ELSE_BODY_STMT_INFO - 1));
			break;
		case STMT_SWITCH:
			stStatementAccess.switch_condExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_SWITCH_COND_INFO - 1));
			stStatementAccess.switch_body.set(tblIndex,
					sqlite3_column_int(stmt, STMT_SWITCH_BODY_STMT_INFO - 1));
			stStatementAccess.switch_firstCase.set(tblIndex,
					sqlite3_column_int(stmt,
					STMT_SWITCH_FIRST_CASE_STMT_INFO - 1));
			stStatementAccess.switch_default.set(tblIndex,
					sqlite3_column_int(stmt,
					STMT_SWITCH_DEFAULT_STMT_INFO - 1));
			break;
		case STMT_WHILE:
			stStatementAccess.while_condExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_WHILE_COND_EXP_INFO - 1));
			stStatementAccess.while_body.set(tblIndex,
					sqlite3_column_int(stmt, STMT_WHILE_BODY_STMT_INFO - 1));
			break;
		case STMT_DO:
			stStatementAccess.do_body.set(tblIndex,
					sqlite3_column_int(stmt, STMT_DO_BODY_STMT_INFO - 1));
			stStatementAccess.do_condExp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_DO_COND_EXP_INFO - 1));
			break;
		case STMT_GOTO:
			stStatementAccess.goto_sym.set(tblIndex,
					sqlite3_column_int(stmt, STMT_GOTO_LABEL_SYMBOL_INFO - 1));
			stStatementAccess.goto_statement.set(tblIndex,
					sqlite3_column_int(stmt, STMT_GOTO_LABEL_STMT_INFO - 1));
			break;
		case STMT_CONTINUE:
			stStatementAccess.continue_statement.set(tblIndex,
					sqlite3_column_int(stmt, STMT_CONTINUE_LOOP_STMT_INFO - 1));
			break;
		case STMT_BREAK:
			stStatementAccess.break_statement.set(tblIndex,
					sqlite3_column_int(stmt,
					STMT_BREAK_LOOP_OR_SWITCH_STMT_INFO - 1));
			break;
		case STMT_RETURN:
			stStatementAccess.return_exp.set(tblIndex,
					sqlite3_column_int(stmt, STMT_RETURN_EXP_INFO - 1));
			break;
		default:
			break;
		}

		stStatementAccess.codeScp.set(tblIndex,
				sqlite3_column_int(stmt, STMT_CODE_SCOPE_INFO - 1));

		parentKind = sqlite3_column_int(stmt, STMT_PARENT_KIND - 1);
		stStatementAccess.parentKind.set(tblIndex, parentKind);

		switch (parentKind) {
		case KIND_SYMDEFINFO:
			stStatementAccess.parent_Symbol.set(tblIndex,
					sqlite3_column_int(stmt, STMT_PARENT_TABLE_INFO - 1));
			break;
		case KIND_STATEMENTINFO:
			stStatementAccess.parent_statement.set(tblIndex,
					sqlite3_column_int(stmt, STMT_PARENT_TABLE_INFO - 1));
			break;
		case KIND_EXPRESSIONINFO:
			stStatementAccess.parent_expression.set(tblIndex,
					sqlite3_column_int(stmt, STMT_PARENT_TABLE_INFO - 1));
			break;
		default:
			break;
		}

		stStatementAccess.before.set(tblIndex,
				sqlite3_column_int(stmt, STMT_BEFORE - 1));
		stStatementAccess.next.set(tblIndex,
				sqlite3_column_int(stmt, STMT_NEXT - 1));
		stStatementAccess.begin.set(tblIndex,
				sqlite3_column_int(stmt, STMT_LIST_BEGINE - 1));
		stStatementAccess.end.set(tblIndex,
				sqlite3_column_int(stmt, STMT_LIST_END - 1));
	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_SYMBOLINFO*/
static INT loadSymbolInfo(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_SYMBOLINFO, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stSymbolInfoAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stSymbolInfoAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		stSymbolInfoAccess.symClass.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_CLASS - 1));

		stSymbolInfoAccess.nameSpace.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_NAMESPACE - 1));

		stSymbolInfoAccess.kind.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_KIND - 1));

		stSymbolInfoAccess.linkage.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_LINKAGE_INFO - 1));

		stSymbolInfoAccess.type.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_TYPE_INFO - 1));

		stSymbolInfoAccess.name.set(tblIndex,
				(PSZ) sqlite3_column_text(stmt, SYMBOL_NAME - 1));

		stSymbolInfoAccess.functionBody.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_FUNCTION_BODY_STMT_INFO - 1));

		stSymbolInfoAccess.codeScp.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_CODE_SCOPE_INFO - 1));

		stSymbolInfoAccess.dataSection.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_DATA_SECTION_INFO - 1));

		stSymbolInfoAccess.initialExpList.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_INIT_EXP_LIST_INFO - 1));

		stSymbolInfoAccess.value.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_INIT_VALUE_INFO - 1));

		stSymbolInfoAccess.memOffset.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_MEMBER_OFFSET_BYTES - 1));

		stSymbolInfoAccess.referred.set(tblIndex,
				sqlite3_column_int(stmt, SYMBOL_IS_REFERRED - 1));

	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_LINKAGE*/
static INT loadLinkage(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;", TBL_LINKAGE,
			transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stCCLinkageAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stCCLinkageAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		stCCLinkageAccess.bExternal.set(tblIndex,
				sqlite3_column_int(stmt, LINK_IS_EXTERNAL - 1));

		stCCLinkageAccess.definitionChain.set(tblIndex,
				sqlite3_column_int(stmt, LINK_DEFINITION_CHAIN_INFO - 1));

		stCCLinkageAccess.tenDeclChain.set(tblIndex,
				sqlite3_column_int(stmt, LINK_TEN_DECL_CHAIN_INFO - 1));

		stCCLinkageAccess.allChain.set(tblIndex,
				sqlite3_column_int(stmt, LINK_ALL_CHAIN_INFO - 1));

		stCCLinkageAccess.definitionSym.set(tblIndex,
				sqlite3_column_int(stmt, LINK_DEF_SYMBOL_INFO - 1));

		stCCLinkageAccess.bReferred.set(tblIndex,
				sqlite3_column_int(stmt, LINK_IS_REFERRED - 1));
	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_TYPEINFO*/
static INT loadTypeInfo(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_TYPEINFO, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stTypeInfoAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stTypeInfoAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		stTypeInfoAccess.typeKind.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_KIND - 1));

		stTypeInfoAccess.signFlag.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_SIGN - 1));

		stTypeInfoAccess.longShortFlg.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_LENGTH - 1));

		stTypeInfoAccess.intFloat.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_FLOATING - 1));

		stTypeInfoAccess.typeQual.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_EQUAL - 1));

		stTypeInfoAccess.size.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_SIZE - 1));

		stTypeInfoAccess.elementType.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_ELEMENT_TYPE_INFO - 1));

		stTypeInfoAccess.noQualType.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_NONE_QUALIFIER_TYPE_INFO - 1));

		stTypeInfoAccess.memChain.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_MEMBER_CHAIN_INFO - 1));

		stTypeInfoAccess.tagInfo.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_TAG_SYMBOL_INFO - 1));

		stTypeInfoAccess.next.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_NEXT - 1));

		stTypeInfoAccess.bSizeUnDefined.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_UNDEF_FLAG - 1));

		stTypeInfoAccess.bVariableSize.set(tblIndex,
				sqlite3_column_int(stmt, TYPE_VSIZE_FLAG - 1));
	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_VALUEINFO*/
static INT loadValueInfo(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;
	AST typeKind = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_VALUEINFO, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stValueInfoAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stValueInfoAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		typeKind = sqlite3_column_int(stmt, VALUE_TYPE_INFO - 1);
		stValueInfoAccess.type.set(tblIndex, typeKind);

		switch (typeKind) {
		case TYPE_CHAR:
		case TYPE_SIGNED_CHAR:
		case TYPE_UNSIGNED_CHAR:
		case TYPE_SHORT:
		case TYPE_SIGNED_SHORT:
		case TYPE_UNSIGNED_SHORT:
		case TYPE_INT:
		case TYPE_SIGNED_INT:
			stValueInfoAccess.s4value.set(tblIndex,
					sqlite3_column_int(stmt, VALUE_INTEGER_VALUE - 1));
			break;
		case TYPE_UNSIGNED_INT:
			stValueInfoAccess.u4value.set(tblIndex,
					sqlite3_column_int(stmt, VALUE_INTEGER_VALUE - 1));
			break;
		case TYPE_LONG:
		case TYPE_SIGNED_LONG:
		case TYPE_LONG_LONG:
		case TYPE_SIGNED_LONG_LONG:
			stValueInfoAccess.s8value.set(tblIndex,
					sqlite3_column_int(stmt, VALUE_INTEGER_VALUE - 1));
			break;
		case TYPE_UNSIGNED_LONG:
		case TYPE_UNSIGNED_LONG_LONG:
			stValueInfoAccess.u8value.set(tblIndex,
					sqlite3_column_int(stmt, VALUE_INTEGER_VALUE - 1));
			break;
		case TYPE_FLOAT:
		case TYPE_DOUBLE:
		case TYPE_LONG_DOUBLE:
			stValueInfoAccess.dvalue.set(tblIndex,
					sqlite3_column_double(stmt, VALUE_FLOATING_VALUE - 1));
			break;
		default:
			stValueInfoAccess.s4value.set(tblIndex, 0);
			stValueInfoAccess.dvalue.set(tblIndex, 0.0);
			break;
		}

	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*TBL_UNITECHAIN*/
static INT loadUniteChain(sqlite3 * db, AST transUnitInfo) {
	INT rc = 0;
	PSZ sql_get = NULL;
	const char *zTail;
	sqlite3_stmt * stmt = NULL;

	AST tblIndex = 0;
	U2 chainKind = 0;

	sql_get = sqlite3_mprintf(
			"SELECT * FROM %q WHERE TblUnit=%d ORDER BY TblIndex;",
			TBL_UNITECHAIN, transUnitInfo);
	rc = sqlite3_prepare(db, (const char *) sql_get, -1, &stmt, &zTail);
	if (rc != SQLITE_OK || stmt == NULL ) {
		if (sql_get != NULL ) {
			sqlite3_free(sql_get);
		}
		if (stmt != NULL ) {
			sqlite3_finalize(stmt);
		}
		return COEXIT_ERROR;
	}

	while (sqlite3_step(stmt) == SQLITE_ROW) {
		stUniteChainAccess.alloc(1);
		tblIndex = sqlite3_column_int(stmt, CC_TABLE_INDEX - 1);

		if (tblIndex != stUniteChainAccess.getMax()) {
			rc = COEXIT_ERROR;
			break;
		}

		chainKind = sqlite3_column_int(stmt, CHAIN_KIND - 1);
		stUniteChainAccess.kind.set(tblIndex, chainKind);

		switch (chainKind) {
		case KIND_SYMDEFINFO:
			stUniteChainAccess.parameter_sym.set(tblIndex,
					sqlite3_column_int(stmt, CHAIN_TABLE_INFO - 1));
			break;
		case KIND_STATEMENTINFO:
			stUniteChainAccess.parameter_stmt.set(tblIndex,
					sqlite3_column_int(stmt, CHAIN_TABLE_INFO - 1));
			break;
		case KIND_DECLARATION:
			stUniteChainAccess.parameter_decl.set(tblIndex,
					sqlite3_column_int(stmt, CHAIN_TABLE_INFO - 1));
			break;
		default:
			break;
		}

		stUniteChainAccess.before.set(tblIndex,
				sqlite3_column_int(stmt, CHAIN_PRE_CHAIN_INFO - 1));

		stUniteChainAccess.next.set(tblIndex,
				sqlite3_column_int(stmt, CHAIN_NEXT_CHAIN_INFO - 1));

	}
	if (sql_get != NULL ) {
		sqlite3_free(sql_get);
	}
	if (stmt != NULL ) {
		rc = sqlite3_finalize(stmt);
	}
	return rc;
}

/*load cc all of a unit*/
INT DLL_EXPORT loadUnitCcData(sqlite3 * coreData, AST transUnitInfo) {
	INT rc = 0;

	rc = loadDeclaration(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadDeclarator(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadTypeSpecifier(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadExpression(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadExpressionList(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadInitializerDesignation(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadStatement(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadSymbolInfo(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadLinkage(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadTypeInfo(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadValueInfo(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	rc = loadUniteChain(coreData, transUnitInfo);
	if (rc != COEXIT_SUCCESS) {
		return rc;
	}

	return COEXIT_SUCCESS;
}

VOID DLL_EXPORT clearUnitCc(VOID) {
	stDeclarationAccess.clear();
	stDeclaratorAccess.clear();
	stTypeSpecifierAccess.clear();
	stExpressionAccess.clear();
	stExpressionListAccess.clear();
	stInitDesignationAccess.clear();
	stStatementAccess.clear();
	stSymbolInfoAccess.clear();
	stCCLinkageAccess.clear();
	stTypeInfoAccess.clear();
	stValueInfoAccess.clear();
	stUniteChainAccess.clear();
}
